<div id="includingStuff">
<!--include js/css-->
<?php Yii::app()->clientScript->registerCssFile(
    Yii::app()->baseUrl . '/css/stock/stock.css'
); ?>

<!--Yii's default script.-->
<?php
    Yii::app()->clientScript->registerScript(
        'search',
        "
        $('.search-button').click(function() {
            $('.search-form').toggle();
            return false;
        });
        $('.search-form form').submit(function() {
            $.fn.yiiGridView.update('stock-grid', {
                data: $(this).serialize()
            });
            return false;
        });
        "
    );
?>
</div><!--includingStuff-->

<!--Sub-menu-->
<?php require __DIR__ . '/../_submenu.php'; ?>

<h1>Manage Stocks</h1>

<div id="searchFromWrapper">
    <div id="searchButton">
        <?php echo CHtml::link('Search', '#', array('class' => 'search-button')); ?>
    </div>

    <div id="searchForm" class="search-form" style="display:none">
        <?php
        $this->renderPartial('_search', array(
            'model' => $model,
        ));
        ?>
    </div>
</div><!-- Search-form -->

<?php $this->renderPartial('_inlineEditor', array(
    'model' => $model,
    'dataProvider' => $model->search(),
    'filter' => $model,
))?>